Waypoints can be set when giving a unit "go to" orders. One way to give a unit "go to" orders is to click on it to activate it, then hold down the left mouse button and drag a "movement arrow" to where you want the unit to go. You can set waypoints by pressing the SPACE BAR while the arrow is over a particular square. You can also set waypoints while giving a unit Patrol orders, in similar fashion.